package month3.day30;

import java.util.Scanner;

public class ZuilinText {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
        Zulingonsi z = new Zulingonsi("金路至尊租赁有限公司", "99999999");
        while (true) {
            System.out.println(z.getName() + "欢迎您，请致电" + z.getDianhua() + "洽谈相关租赁业务\n本公司现有" + (z.count - z.zulingshu) + "车可租");
            System.out.println("1：查看车辆情况；2：租赁，3：还车，4：报废，5：采购新车，6：查看租赁记录，9：退出\n请选择");
            int number = in.nextInt();
            if (number == 1) {
                z.show();
            } else if (number == 2) {
                System.out.println("请选择租赁类型(轿车/客车)");
                String leixing = in.next();
                z.weichuzu(leixing);
                System.out.println("请选择车牌号");
                String chepai = in.next();
                Car car=z.zuche(chepai);
                if (car == null) {
                    System.out.println("租车失败");
                    continue;
                }
                System.out.println("请输入租赁天数");
                int day = in.nextInt();
                System.out.println("请输入租赁人姓名");
                String name = in.next();
                z.zulingxinxis(name,chepai,day);
                double qian=car.zujin(day);
                System.out.println("请支付人民币："+qian+"元");
            } else if (number == 3) {
                z.yichuzu();
                System.out.println("请输入归还车辆车牌");
                String chepai = in.next();
                System.out.println(z.huanche(chepai)?"还车成功！":"还车失败！");
            } else if (number == 4) {
                System.out.println("请选择报废车牌号");
                String chepai = in.next();
                System.out.println(z.baofei(chepai)?"车辆报废成功！":"车辆报废失败！");
                z.baofei(chepai);
            } else if (number == 5) {
                System.out.println("请选择购买新车类型，1：轿车，2(其他)：客车");
                int num = in.nextInt();
                System.out.println("请输入新车车牌");
                String chepai = in.next();
                if (z.panduan(chepai)) {
                    System.out.println("请输入新车品牌");
                    String pingpai = in.next();
                    System.out.println("请输入新车日租金");
                    double money = in.nextInt();
                    if (num == 1) {
                        System.out.println("请输入新车型号");
                        String xinghao = in.next();
                        Jiaoche cars = new Jiaoche(chepai, pingpai, money, xinghao);
                        z.xinche(cars);
                    } else {
                        System.out.println("请输入新车座位数");
                        int zuowei = in.nextInt();
                        Keche cars = new Keche(chepai, pingpai, money, zuowei);
                        z.xinche(cars);
                    }
                } else {
                    System.out.println("车牌重复");
                }

            } else if (number == 6) {
                z.xinxi();
            } else if (number == 7) {

            } else if (number == 8) {

            } else if (number == 9) {
                return;
            }
        }
    }
}
